﻿using System;
using System.Collections.Generic;
using System.Text;

using Pacman.Simulator;
using Pacman.Simulator.Ghosts;
using System.Diagnostics;

namespace PacmanAI
{
	public class TestPac : BasePacman
	{
		public TestPac() : base("TestPac","2") { }

        private int _nextPill = 0;

		public override Direction Think(GameState gs) 
        {
            System.Threading.Thread.Sleep(100);
            if (_nextPill < 4)
            {
                var r = gs.Map.GetRoute(gs.Pacman.Node, gs.Map.PowerPillNodes[_nextPill]);
                if (r != null)
                        return gs.Pacman.Node.GetDirection(r[0]);
                    else
                        _nextPill++;
            }
			return gs.Ghosts[0].Direction;
		}
	}
}
